<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./jquery3.3.1.js"></script>
    <style>
        #box p{width: 100px;height: 100px;margin: 0 auto;background: yellow;}
    </style>
</head>
<body>
    <div id="box">
        hover()事件
        <p>1</p>
    </div>
    <script>
        $(function(){
            $("#box").hover(
                function(){
                    $(this).css("background","blue");
                    var op=$(this).find("p").text();
                    $(this).find("p").text(op+1);
                },
                function(){
                    $(this).css("background","red");
                    var op=$(this).find("p").text();
                    $(this).find("p").text(op+5);
                },
            )
        })
    </script>
</body>
</html>